feat(web): add toggle shortcut for settling threads - #7881
feat(web): add toggle shortcut for settling threads#7881UtkarshUsername wants to merge 16 commits into
Conversation
Settling a thread had no keyboard shortcut. Add thread.settle.toggle (command ID thread.settle.toggle) with default mod+shift+s (when: !terminalFocus) and dispatch in ChatRouteGlobalShortcuts. The handler toggles the active thread via effectiveSettled classification (mirroring Sidebar partition) and calls settleThread/unsettleThread. No mobile changes; desktop inherits via web.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This adds a new global shortcut that performs persistent settle/un-settle mutations and relies on active-thread and PR/VCS state classification. The behavior is focused and reuses existing actions, but its user-facing lifecycle impact warrants human review. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Sidebar partitions snoozed threads before settled ones, but the toggle only excluded pinned threads. A snoozed thread that also satisfies effectiveSettled was treated as settled and would be unsettle-d instead of settled. Mirror the partition ordering by checking effectiveSnoozed first.
|
Fixed: exclude snoozed threads from isSettled to match Sidebar partition ordering (snoozed outranks settled). Now checks effectiveSnoozed before effectiveSettled - a snoozed thread that also satisfies effectiveSettled will correctly settle instead of being incorrectly unsettled. See 6fe4f8a. |
There was a problem hiding this comment.
One finding: the new thread.settle.toggle shortcut classifies the open thread's settled state differently from the two surfaces that display that state for the same thread, so the shortcut can do the opposite of the visible affordance. Details inline on apps/web/src/routes/_chat.tsx.
No styling, primitive, or Tailwind/CSS ownership issues in this diff.
Posted via Macroscope — UI Consistency
The snoozed/pinned exclusions mirrored the sidebar list partition, but the surfaces the user sees on the open thread (parked-thread banner, header menu) classify with effectiveSettled alone. Classify the same way so the shortcut never disagrees with the visible Un-settle button.
There was a problem hiding this comment.
One finding: the settle toggle resolves its changeRequest input from a different source than the two surfaces it is documented to match, so the toggle direction can invert relative to what the user sees.
Posted via Macroscope — UI Consistency
The snapshot map is only written by sidebar v2 rows, so on the legacy sidebar (or before a row mounts) the shortcut classified with no PR while the banner and menu used the live one. Resolve through resolveDisplayedThreadPr over the same vcsEnvironment.status query ChatView uses, so all three surfaces agree.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8c56333. Configure here.
There was a problem hiding this comment.
One finding: the new pending-state fallback makes the settle shortcut classify the open thread differently from the banner and header menu that render its settled state. Details inline.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding: the settle-toggle's PR resolution can disagree with the settled state the same thread renders in ChatView's banner and the chat-header menu. Details inline.
Posted via Macroscope — UI Consistency
The pending-status snapshot fallback diverged from the banner and menu (both resolve unconditionally) and could go stale on a failed status query. Match ChatView's resolution exactly; the loading window behaves the same as the surfaces the user already sees.

What Changed
Add shortcut to settle the active thread with default mod+shift+s (when: !terminalFocus). Dispatch in ChatRouteGlobalShortcuts (apps/web/src/routes/_chat.tsx) toggles the active thread using effectiveSettled classification (mirroring Sidebar partition) and calls settleThread/unsettleThread.
Why
Settling a thread had no keyboard shortcut. It was only available via sidebar hover, action menu, and header menu.
Video
settle.mp4
Checklist
Note
Medium Risk
Mutates thread settlement from a global shortcut using live VCS status and auto-settle settings; a stale or missing git status could toggle the opposite of the visible UI.
Overview
Adds a
thread.settle.toggleshortcut (defaultmod+shift+s, when not in the terminal) so the active thread can be settled or un-settled from the keyboard, matching the banner/header menu.The chat-route global handler classifies the thread with
effectiveSettledusing live VCS status plus change-request snapshots, then callssettleThread/unsettleThread. It no-ops without an active thread, on key repeat, or if the environment lacksthreadSettlement, and toasts non-interrupted failures.Reviewed by Cursor Bugbot for commit af57392. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
thread.settle.toggleshortcut bound tomod+shift+sin chat routethread.settle.togglecommand in keybindings.ts and maps it tomod+shift+swhen!terminalFocusin keybindings.tseffectiveSettledwith minute-quantized time and auto-settle settings, then callssettleThreadorunsettleThreadaccordinglythreadSettlementcapabilityactiveThreadShell,gitStatusQuery.data,serverConfigs, auto-settle settings) into the keydown effect's dependency array — stale or missing VCS status data could cause incorrect settle/unsettle decisionsMacroscope summarized af57392.